<?php
$lang = new system_setting_language($this->fromLang);
$this->headScript()->appendFile(_STATIC_HTTP . '/admin/js/_ajax.js');
?>
<?php $this->headScript()->captureStart();?>
$(document).ready(function(){
	_ajax.id = $('#special-list');
	_ajax.form = $('form.ajaxForm');
	_ajax.name = 'special';
	_ajax.loading = $('#special-list').html();
	_ajax.url = '<?php echo $this->url('picture/ajax/importSpecial');?>';
	_ajax.load();
});
<?php $this->headScript()->captureEnd();?>
<form action="" method="post" class="ajaxForm">
<?php
echo $this->form()->hidden('lang', $this->fromLang);
echo $this->form()->hidden('referer', $this->referer) . "\n";
?>
<div class="body">
	<table class="search form">
		<tr>
			<th><?php echo $this->language('SPECIAL LIST FROM');?> [<em class="red"><?php echo $lang->getName();?></em> - <?php echo $lang->getHttp();?>]:</th>
			<th style="width:300px;"><?php echo $this->language('SELECTED ITEM(s)');?></th>
		</tr>
		<tr>
			<td>
				<div class="msg" style="text-align:left;">
					<div class="common ok" style="background:#fff;border:0;">
						<i class="icon"></i>
						<h4>ATTENTION:</h4>
						<div class="msg-bd"><?php echo $this->language('We suggest you that select less than 100 items once time');?>.</div>
					</div>
				</div>
				<div class="search left">
					<span><?php echo $this->partial('picture/_inc/categorySelect.phtml', array('name' => 'category_id'));?></span>
					<span><?php echo $this->render('include/searchInput.phtml');?></span>
					<span><button type="button" value="Search" onclick="_ajax.load();">Search</button></span>
					<label><?php echo $this->language('SELECT ALL');?><input type="checkbox" id="check-all" onclick="_ajax.checkAll(this);" /></label>
					<div class="clear"></div>
				</div>
				<hr/>
				<div id="special-list" class="center">
					<h1 style="padding:10px;"><?php echo $this->language('Loading')?>...</h1>
				</div>
			</td>
			<td>
				<select name="special_id[]" id="special-id-x" style="width:100%;height:345px;" multiple="multiple"><?php 
				foreach($this->specialList AS $special) {
					echo '<option value="' . $special->getId() . '" selected="selected">';
					echo $special->getTitle() . '[' . $special->getName() . '][' . $special->getPtotal() . ']</option>';
				}
				?></select>
				<hr/>
				<button type="submit" name="submit" value="select"><?php echo $this->language('Continue');?> »</button>
				<button type="button" name="cancel" value="cancel" onclick="history.back();"><?php echo $this->language('Cancel');?> »</button>
			</td>
		</tr>
	</table>
</div>
</form>
<?php $this->headStyle()->captureStart();?>
table.form .search span {float:left;padding-right:3px;}
table.form .search label {float:right;line-height:20px;}
<?php $this->headStyle()->captureEnd();?>
